3.312 \(\int (a+b \sec ^2(e+f x)) \tan ^3(e+f x) \, dx\)

Optimal. Leaf size=49 \[ \frac{(a-b) \sec ^2(e+f x)}{2 f}+\frac{a \log (\cos (e+f x))}{f}+\frac{b \sec ^4(e+f x)}{4 f} \]

[Out]

(a*Log[Cos[e + f*x]])/f + ((a - b)*Sec[e + f*x]^2)/(2*f) + (b*Sec[e + f*x]^4)/(4*f)

________________________________________________________________________________________

Rubi [A]  time = 0.0488434, antiderivative size = 49, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 21, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.143, Rules used = {4138, 446, 76} \[ \frac{(a-b) \sec ^2(e+f x)}{2 f}+\frac{a \log (\cos (e+f x))}{f}+\frac{b \sec ^4(e+f x)}{4 f} \]

Antiderivative was successfully verified.

[In]

Int[(a + b*Sec[e + f*x]^2)*Tan[e + f*x]^3,x]

[Out]

(a*Log[Cos[e + f*x]])/f + ((a - b)*Sec[e + f*x]^2)/(2*f) + (b*Sec[e + f*x]^4)/(4*f)

Rule 4138

Int[((a_) + (b_.)*sec[(e_.) + (f_.)*(x_)]^(n_))^(p_.)*tan[(e_.) + (f_.)*(x_)]^(m_.), x_Symbol] :> Module[{ff =
 FreeFactors[Cos[e + f*x], x]}, -Dist[(f*ff^(m + n*p - 1))^(-1), Subst[Int[((1 - ff^2*x^2)^((m - 1)/2)*(b + a*
(ff*x)^n)^p)/x^(m + n*p), x], x, Cos[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f, n}, x] && IntegerQ[(m - 1)/2] &&
IntegerQ[n] && IntegerQ[p]

Rule 446

Int[(x_)^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_.)*((c_) + (d_.)*(x_)^(n_))^(q_.), x_Symbol] :> Dist[1/n, Subst[Int
[x^(Simplify[(m + 1)/n] - 1)*(a + b*x)^p*(c + d*x)^q, x], x, x^n], x] /; FreeQ[{a, b, c, d, m, n, p, q}, x] &&
 NeQ[b*c - a*d, 0] && IntegerQ[Simplify[(m + 1)/n]]

Rule 76

Int[((d_.)*(x_))^(n_.)*((a_) + (b_.)*(x_))*((e_) + (f_.)*(x_))^(p_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*
x)*(d*x)^n*(e + f*x)^p, x], x] /; FreeQ[{a, b, d, e, f, n}, x] && IGtQ[p, 0] && (NeQ[n, -1] || EqQ[p, 1]) && N
eQ[b*e + a*f, 0] && ( !IntegerQ[n] || LtQ[9*p + 5*n, 0] || GeQ[n + p + 1, 0] || (GeQ[n + p + 2, 0] && Rational
Q[a, b, d, e, f])) && (NeQ[n + p + 3, 0] || EqQ[p, 1])

Rubi steps

\begin{align*} \int \left (a+b \sec ^2(e+f x)\right ) \tan ^3(e+f x) \, dx &=-\frac{\operatorname{Subst}\left (\int \frac{\left (1-x^2\right ) \left (b+a x^2\right )}{x^5} \, dx,x,\cos (e+f x)\right )}{f}\\ &=-\frac{\operatorname{Subst}\left (\int \frac{(1-x) (b+a x)}{x^3} \, dx,x,\cos ^2(e+f x)\right )}{2 f}\\ &=-\frac{\operatorname{Subst}\left (\int \left (\frac{b}{x^3}+\frac{a-b}{x^2}-\frac{a}{x}\right ) \, dx,x,\cos ^2(e+f x)\right )}{2 f}\\ &=\frac{a \log (\cos (e+f x))}{f}+\frac{(a-b) \sec ^2(e+f x)}{2 f}+\frac{b \sec ^4(e+f x)}{4 f}\\ \end{align*}

Mathematica [A]  time = 0.080193, size = 43, normalized size = 0.88 \[ \frac{a \left (\tan ^2(e+f x)+2 \log (\cos (e+f x))\right )}{2 f}+\frac{b \tan ^4(e+f x)}{4 f} \]

Antiderivative was successfully verified.

[In]

Integrate[(a + b*Sec[e + f*x]^2)*Tan[e + f*x]^3,x]

[Out]

(b*Tan[e + f*x]^4)/(4*f) + (a*(2*Log[Cos[e + f*x]] + Tan[e + f*x]^2))/(2*f)

________________________________________________________________________________________

Maple [A]  time = 0.048, size = 50, normalized size = 1. \begin{align*}{\frac{ \left ( \tan \left ( fx+e \right ) \right ) ^{2}a}{2\,f}}+{\frac{a\ln \left ( \cos \left ( fx+e \right ) \right ) }{f}}+{\frac{b \left ( \sin \left ( fx+e \right ) \right ) ^{4}}{4\,f \left ( \cos \left ( fx+e \right ) \right ) ^{4}}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+b*sec(f*x+e)^2)*tan(f*x+e)^3,x)

[Out]

1/2/f*a*tan(f*x+e)^2+a*ln(cos(f*x+e))/f+1/4/f*b*sin(f*x+e)^4/cos(f*x+e)^4

________________________________________________________________________________________

Maxima [A]  time = 1.03266, size = 86, normalized size = 1.76 \begin{align*} \frac{2 \, a \log \left (\sin \left (f x + e\right )^{2} - 1\right ) - \frac{2 \,{\left (a - b\right )} \sin \left (f x + e\right )^{2} - 2 \, a + b}{\sin \left (f x + e\right )^{4} - 2 \, \sin \left (f x + e\right )^{2} + 1}}{4 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sec(f*x+e)^2)*tan(f*x+e)^3,x, algorithm="maxima")

[Out]

1/4*(2*a*log(sin(f*x + e)^2 - 1) - (2*(a - b)*sin(f*x + e)^2 - 2*a + b)/(sin(f*x + e)^4 - 2*sin(f*x + e)^2 + 1
))/f

________________________________________________________________________________________

Fricas [A]  time = 0.525979, size = 128, normalized size = 2.61 \begin{align*} \frac{4 \, a \cos \left (f x + e\right )^{4} \log \left (-\cos \left (f x + e\right )\right ) + 2 \,{\left (a - b\right )} \cos \left (f x + e\right )^{2} + b}{4 \, f \cos \left (f x + e\right )^{4}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sec(f*x+e)^2)*tan(f*x+e)^3,x, algorithm="fricas")

[Out]

1/4*(4*a*cos(f*x + e)^4*log(-cos(f*x + e)) + 2*(a - b)*cos(f*x + e)^2 + b)/(f*cos(f*x + e)^4)

________________________________________________________________________________________

Sympy [A]  time = 2.35166, size = 80, normalized size = 1.63 \begin{align*} \begin{cases} - \frac{a \log{\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} + \frac{a \tan ^{2}{\left (e + f x \right )}}{2 f} + \frac{b \tan ^{2}{\left (e + f x \right )} \sec ^{2}{\left (e + f x \right )}}{4 f} - \frac{b \sec ^{2}{\left (e + f x \right )}}{4 f} & \text{for}\: f \neq 0 \\x \left (a + b \sec ^{2}{\left (e \right )}\right ) \tan ^{3}{\left (e \right )} & \text{otherwise} \end{cases} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sec(f*x+e)**2)*tan(f*x+e)**3,x)

[Out]

Piecewise((-a*log(tan(e + f*x)**2 + 1)/(2*f) + a*tan(e + f*x)**2/(2*f) + b*tan(e + f*x)**2*sec(e + f*x)**2/(4*
f) - b*sec(e + f*x)**2/(4*f), Ne(f, 0)), (x*(a + b*sec(e)**2)*tan(e)**3, True))

________________________________________________________________________________________

Giac [B]  time = 1.83268, size = 343, normalized size = 7. \begin{align*} -\frac{2 \, a \log \left (-\frac{\cos \left (f x + e\right ) + 1}{\cos \left (f x + e\right ) - 1} - \frac{\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1} + 2\right ) - 2 \, a \log \left (-\frac{\cos \left (f x + e\right ) + 1}{\cos \left (f x + e\right ) - 1} - \frac{\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1} - 2\right ) + \frac{3 \, a{\left (\frac{\cos \left (f x + e\right ) + 1}{\cos \left (f x + e\right ) - 1} + \frac{\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1}\right )}^{2} + 20 \, a{\left (\frac{\cos \left (f x + e\right ) + 1}{\cos \left (f x + e\right ) - 1} + \frac{\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1}\right )} + 28 \, a - 16 \, b}{{\left (\frac{\cos \left (f x + e\right ) + 1}{\cos \left (f x + e\right ) - 1} + \frac{\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1} + 2\right )}^{2}}}{4 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sec(f*x+e)^2)*tan(f*x+e)^3,x, algorithm="giac")

[Out]

-1/4*(2*a*log(-(cos(f*x + e) + 1)/(cos(f*x + e) - 1) - (cos(f*x + e) - 1)/(cos(f*x + e) + 1) + 2) - 2*a*log(-(
cos(f*x + e) + 1)/(cos(f*x + e) - 1) - (cos(f*x + e) - 1)/(cos(f*x + e) + 1) - 2) + (3*a*((cos(f*x + e) + 1)/(
cos(f*x + e) - 1) + (cos(f*x + e) - 1)/(cos(f*x + e) + 1))^2 + 20*a*((cos(f*x + e) + 1)/(cos(f*x + e) - 1) + (
cos(f*x + e) - 1)/(cos(f*x + e) + 1)) + 28*a - 16*b)/((cos(f*x + e) + 1)/(cos(f*x + e) - 1) + (cos(f*x + e) -
1)/(cos(f*x + e) + 1) + 2)^2)/f